<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('规则1')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label style="width: 100px;">渠道商户号：</label>
                            <input type="text" name="bankbno"/>
                        </li>
                        <li>
                            <label style="width: 100px;">地区码：</label>
                            <input type="text" name="area"/>
                        </li>
                        <li>
                            <label style="width: 100px;">商编类型：</label>
                            <input type="text" oninput="value=value.replace(/[^\d]/g,'')" name="ratetype"/>
                        </li>
                        <li>
                            <label style="width: 100px;">商编状态：</label>
                            <input type="text" oninput="value=value.replace(/[^\d]/g,'')" name="status"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="addBankBnoSerialInfo()" shiro:hasPermission="tBankinfo:tBankinfo:addBankBnoSerialInfo">
                <i class="fa fa-plus"></i> 添加
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "tBankinfo/tBankinfo";
    var editFlag = [[${@permission.hasPermi('tBankinfo:tBankinfo:editBankBnoSerialInfo')}]];
    var removeFlag = [[${@permission.hasPermi('tBankinfo:tBankinfo:removeBankBnoSerialInfo')}]];
    $(function()  {
        var options = {
            url: prefix + "/listBankBnoSerialInfoMap",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            clickToSelect:true,
            columns: [
                {
                    field : 'BANKBNO',
                    title : '渠道商户号'
                },
                {
                    field : 'COUNTSERIAL',
                    title : '最高交易笔数'
                },
                {
                    field : 'SUMMONEY',
                    title : '最高交易金额'
                },
                {
                    field : 'RATETYPE',
                    title : '商编类型'
                },
                {
                    field : 'STATUS',
                    title : '商编状态'
                },
                {
                    field : 'NOWCOUNTSERIAL',
                    title : '当日交易笔数'
                },
                {
                    field : 'NOWSUMMONEY',
                    title : '当日交易金额'
                },
                {
                    field : 'AREA',
                    title : '地区码',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="editBankBnoSerialInfo(\''+row.BANKBNO+'\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="removeBankBnoSerialInfo(\'' + row.BANKBNO + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });

    function addBankBnoSerialInfo() {
        $.modal.open("新增规则1",prefix + "/addBankBnoSerialInfo/" ,'800');
    }

    function editBankBnoSerialInfo(bankbno) {
        $.modal.open("修改规则1",prefix + "/editBankBnoSerialInfo/"+bankbno ,'800');
    }

    function removeBankBnoSerialInfo(bankbno) {
        $.modal.confirm("删除需谨慎，确定删除吗？", function() {
            $.operate.post(prefix + "/removeBankBnoSerialInfo", { "bankbno": bankbno});
        })
    }
</script>
</body>
</html>